package com.dlz.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dlz.entity.User;
import com.dlz.mapper.UserMapper;
import com.dlz.service.TestDubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <dl>
 * <dt><span class="strong">类说明:</span></dt>
 * <dd>用一句话描述该类作用</dd>
 * </dl>
 * <dl>
 * <dt><span class="strong">创建时间:</span></dt>
 * <dd>2017/3/21 11:10</dd>
 *
 * </dl>
 *
 * @author duan_lizhi
 * @since 1.0
 */
@RestController
@RequestMapping("/dlz/hello")
public class HelloWord {

    @Autowired
    private TestDubboService testDubboService;

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/world")
    public String index() {
        return "Hello spring boot";
    }

    @RequestMapping("/hello")
    public String hello() {
        return testDubboService.getHello();
    }

    @RequestMapping("/user")
    public User user() {
        User user = userMapper.findUserById(1);
        return user;
    }

}
